<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<meta http-equiv="Content-Script-Type" content="text/javascript">
		<meta http-equiv="Content-Style-Type" content="text/css">
		<script type="text/javascript" src="prototype.js"></script>
		<style>
			body {
				min-width:400px;
				overflow-x:hidden;
				font-family: verdana;
				font-size: 10px;
				
			}
		</style>
	</head>
	<body>
	<script type="text/javascript">
		
		// populate background page's variables' content to local vars
		// directly cast to prototype array
				
		var FfaTagList = $A(chrome.extension.getBackgroundPage().FfaTagList);
		var DfaTagList = chrome.extension.getBackgroundPage().DfaTagList;

		// static test values
		var parameters = $H({"test1": 1, "test2": "2"});

		// filter duplicated entries with prototype function .uniq()
		// FfaTagList.sort();
		// FfaTagList = FfaTagList.uniq();
		// DfaTagList = DfaTagList.uniq();
		
		// compose popup content
		
		document.write("FFA tags in this page:<br/>");
		
		FfaTagList.each(function(item){
		
			document.write(item + "<br/>");
			// TODO: populate parameters hash with key value pairs from URL string
			
			parameters.each(function(item) {
				document.write("key: " + item.key + "; value: " + item.value + "<br/>");
			});
			// TODO: truncate/flush parameters hash
		});



		
		document.write("<br/>DFA tags in this page:<br/>");
		
		DfaTagList.each(function(item){
		
			document.write(item + "<br/>");
		});
	</script>
	
	</body>
</html>

